package com.kangyi.admin.mapper;

import com.kangyi.admin.annotation.AutoFill;
import com.kangyi.dto.NursingHomeBasicInformationDTO;
import com.kangyi.entity.NursingHome;
import com.kangyi.enumeration.OperationType;
import com.kangyi.vo.NursingHomeBasicInformationVO;
import com.kangyi.vo.NursingHomeOverviewVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author Blank
 * @version 1.0
 */
@Mapper
public interface NursingHomeMapper {

    NursingHomeOverviewVO getOverview(Integer id);

    NursingHomeBasicInformationVO inquiryBasicInformation(Integer id);

    @AutoFill(value = OperationType.UPDATE)
    void updateBasicInformation(NursingHome nursingHome);

    @Select("select * from nursing_home where id = #{nursingHomeId}")
    NursingHome selectById(Integer nursingHomeId);

    @Update("update nursing_home set image = #{image} where id = #{id}")
    @AutoFill(value = OperationType.UPDATE)
    void updateImage(Integer id, String image);

    @AutoFill(value = OperationType.INSERT)
    void addNursingHome(NursingHome nursingHome);

    @Delete("delete from nursing_home where id = #{nursingHomeId};")
    void deleteByNursingHomeId(Integer nursingHomeId);
}
